angular.module('${menuCode}')
.filter('to_trusted', ['$sce', function ($sce) {
	return function (text) {
	    return $sce.trustAsHtml(text);
	};
}])
.controller("${widgetCode}Ctrl",function($scope,AppKit){
	//$scope.user = {"id":"1111","name":"章鱼","sex":"男","code":"A0001","desc":"分享SOA平台软件，传递敏捷集成机制"};
	var url = '/portal/resource?MobileUserPersonalInfoDataProvider&actionType=retrieveUserInfo';
	AppKit.getJsonApi(url).success(function(jsonData){
		$scope.user = jsonData;
	});
	
	$scope.setupProfile = function(){
		$scope.modalTitle = "我的个人设置";
		$scope.currentInfoId = '1';
		AppKit.createModal("mine-setting-modal",$scope);			
	}
	
	$scope.saveProfile = function(){
		var url = "/portal/index?ForumUserInfoEdit&actionType=mobileSaveProfile"
		AppKit.postJsonApi(url,$scope.user).then(function(response){
			if ("success" == response.data){
				AppKit.successPopup();				
			}else{
				AppKit.errorPopup();
			}
		});
	}
});